{% extends "base.html" %}

{% block content %}
<h2>Archiwum</h2>
<!--{% if msg %}
<b>{{msg}}</b>
{% endif %}-->
<center>{{years}}</center>
<table>
    <thead>
        <th>Student</th>
        <th>Firma</th>
        <th>Daty trwania</th>
        <th>Akademik?</th>
        <th>Płatna?</th>
        <th>Zagraniczna?</th>
        <th>Ocena</th>
        <th>Akcje</th>
    </thead>
{% for training in trainings %}
    <tr>
        <td><a href="/students/show/{{ training.student.id }}/">{{ training.student }}</a></td>
        <td>{{ training.branch }}</td>
        <td>{{ training.training_date }}</td>
        <td>{% if training.hostel %} tak {% else %} nie {% endif %}</td>
        <td>{% if training.payable %} tak {% else %} nie {% endif %}</td>
        <td>{% if training.abroad %} tak {% else %} nie {% endif %}</td>
        <td>
            {% if training.pass_date %}
                {% firstof training.mark "Zal" %}
            {% else %}
                Brak zaliczenia
            {% endif %}
        </td>
        <td>
            <a href="/trainings/edit/{{ training.id }}/">Edytuj</a>
            <a href="recover/{{ training.id }}/">Przywróć</a>
        </td>
    </tr>
{% endfor %}
</table>
{% endblock %}

